package com.jims.master.common.utils;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.apache.commons.lang3.StringUtils;

public class PojoUtils {
	
	 /**
	   * @Title:
	   * @Description: 检查Entity的参数是否必传
	   * @return
	   * @author xiangqiang
	   * @date 2017/11/9
	   * @throws
	  */

	public Boolean converWeixinXmlEntity(String checkFiled[],Object dest_obj) throws Exception {
		for(int j=0 ; j<checkFiled.length ; j++){
			String name = checkFiled[j];
			Method m = dest_obj.getClass().getMethod("get"+StringUtil.toUpperCaseFirstOne(name));
            String orig_val = (String) m.invoke(dest_obj);
			if(StringUtils.isBlank(orig_val)){
				return false;
			}
		}
		return true;
	}

 }
